﻿#include <iostream>
#include <string>
#include <thread>

#include <zmq.hpp>
#include "../../inc/helper.hpp"

int main()
{
	zmq::context_t ctx;
	zmq::socket_t sink(ctx, zmq::socket_type::router);
	sink.bind("inproc://example");

	zmq::socket_t anonymous(ctx, zmq::socket_type::req);
	anonymous.connect("inproc://example");
	send_string(anonymous, "ROUTER uses a generated UUID");
	dump_recved_msg(sink);

	zmq::socket_t identified(ctx, zmq::socket_type::req);
	identified.setsockopt(ZMQ_IDENTITY, "PEER2", 5);
	identified.connect("inproc://example");
	send_string(identified, "ROUTER socket uses REQ's socket identity");
	dump_recved_msg(sink);

	pause();
}
